package com.demo.demo01;


import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component("aspect")
@Aspect
public class AspectDemo {

    /**
     * 前置增强
     */
    @Before("execution(public void com.demo.demo01.TargetImpl.targetMethod())")
    public void before() {
        System.out.println("前置增强方法执行！");
    }

    @After("execution(public void com.demo.demo01.TargetImpl.targetMethod())")
    public void After() {
        System.out.println("后置增强方法执行！");
    }
}
